using UnityEngine;
using QFramework;
using UnityEngine.SceneManagement;
using System.Linq;

namespace projectgame
{
    public partial class GameController : ViewController
    {
        void Start()
        {


            ChallengeController.OnChallengeFinish.Register(Challenge =>
            {
                AudioController.Get.SfxChallengeFinish.Play();

                if (ChallengeController.Challenges.All(challenge=>challenge.State==Challenge.States.Finished))
                	{
                		ActionKit.Delay(0.5f, () =>
                		{
                			SceneManager.LoadScene("GamePass");
                		}).Start(this);
                	}

                         }).UnRegisterWhenGameObjectDestroyed(this);
                //// Code Here
        }
        void Update()
        {

        }
    }
}
